import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import randn

mpl.use('Agg')

def draw(datas):

	y1=[10,13,5,40,30,60,70,12,55,25] 
	x1=range(0,10) 
	x2=range(0,10) 
	y2=[5,8,0,30,20,40,50,10,40,15] 
	plt.plot(x1,y1,label='Frist line',linewidth=3,color='r',marker='o', 
	markerfacecolor='blue',markersize=12) 
	plt.plot(x2,y2,label='second line') 
	plt.xlabel('Plot Number') 
	plt.ylabel('Important var') 
	plt.title('Interesting Graph\nCheck it out') 
	plt.legend() 
	plt.show()
	plt.savefig('/root/classification_pr.png')

def drawpic():
	fig = plt.figure()
	ax1 = fig.add_subplot(2,2,1)
	ax2 = fig.add_subplot(2,2,2)
	ax3 = fig.add_subplot(2,2,3)
	ax4 = fig.add_subplot(2,2,4)
	plt.plot(randn(50).cumsum(), 'k--')
	ax1.hist(randn(100), bins=20, color = 'k', alpha = 0.3)
	ax2.scatter(np.arange(30), np.arange(30) + 3 * randn(30))

	plt.savefig('/root/clapr.png')


def getdata():
	f = open('/root/gitlearn/1-0.2.txt')
	li = f.readlines()
	datas = []
	for line in li:
		li_1 = line.split('     ')
		tur = (float(li_1[0]), float(li_1[1]))
		datas.append(tur)
	return datas

drawpic()

#draw()
